package com.cesce.batch.cobros.validation;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.springmodules.validation.valang.functions.AbstractFunction;
import org.springmodules.validation.valang.functions.Function;

public class ValidacionNumerica extends AbstractFunction{
	protected final Log logger = LogFactory.getLog(getClass());
	
	Boolean validacion = Boolean.FALSE;

    public ValidacionNumerica(Function[] arguments, int line, int column) {
        super(arguments, line, column);
        definedExactNumberOfArguments(1);
    }
    
    @SuppressWarnings("unchecked")
	protected Object doGetResult(Object target) throws Exception {
    	String str = (String) getArguments()[0].getResult(target);
    	validacion = str.matches("^\\d*$");
    	return validacion;
    
    }
    

}
